#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <unordered_map>

using namespace std;

class Solution {
public:
    int lengthOfLongestSubstring(string s) {
        int left = 0, right = 0;
        int n = s.size();
        int len = 0;
        unordered_map<char, int> hash;
        while (right < n)
        {
            hash[s[right]]++;
            while (hash[s[right]] == 2)
            {
                hash[s[left++]]--;
            }
            len = max(len, right - left + 1);
            right++;
        }

        return len;
    }
};

int main()
{

	return 0;
}